#!/bin/bash
BASEPATH=$(cd "$(dirname "$0")"; pwd)
case $1 in
    dev)
        python $BASEPATH/manage.py runserver 0.0.0.0:$2 --settings=c21_qrcode.settings.dev
        ;;
    test)
        nohup python $BASEPATH/manage.py runserver 0.0.0.0:$2 --settings=c21_qrcode.settings.test &
        ;;
    staging)
        nohup python $BASEPATH/manage.py runserver 0.0.0.0:$2 --settings=c21_qrcode.settings.staging &
        ;;
    production)
        nohup python $BASEPATH/manage.py runserver 0.0.0.0:$2 --settings=c21_qrcode.settings.production &
        ;;
    *)
      echo "Usage: $0 [dev|test|staging|production] port"
      exit 1
      ;;
esac
exit 0
